﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YSC_Services.BLL.Services.Interfaces;

namespace YSC_Backstage_Web.Controllers
{
    /// <summary>
    /// 用户认证
    /// </summary>
    public class UserAttestController : Controller
    {

        private IUserBackstageServices _rep;
        public UserAttestController(IUserBackstageServices rep)
        {
            this._rep = rep;
        }

        /// <summary>
        /// 认证申请列表
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            return View();
        }

        public IActionResult UnitAll(string id)
        {
            ViewData["Id"] = id;

            return View();
        }

        public IActionResult Attest(string id)
        {
            ViewData["Id"] = id;

            return View();
        }

        /// <summary>
        /// 用户认证审核
        /// </summary>
        /// <param name="userAttestId"></param>
        /// <param name="Remarks"></param>
        /// <param name="isAttest">0:通过认证 1;否决</param>
        public JsonResult UserIsAttest(string userAttestId, string Remarks, int isAttest)
        {
            var ret = _rep.UserIsAttest(userAttestId, Remarks, isAttest);
            return Json(ret);
        }


        /// <summary>
        /// 审核列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <param name="sasearch"></param>
        /// <returns></returns>
        public JsonResult UserAttestAll(int index, int size, string sasearch)
        {
            var ret = _rep.UserAttestAll(index, size, sasearch);
            return Json(ret);
        }

        /// <summary>
        /// 审核市场列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <param name="userAttestId"></param>
        /// <returns></returns>
        public JsonResult UserAttestUnitAll(int index, int size, string userAttestId)
        {
            var ret = _rep.UserAttestUnitAll(index, size, userAttestId);
            return Json(ret);
        }
    }
}